<?php
	include "../../config.php";
?>
<?php
		if(!$_POST){// chua co du lieu gui len
			include ADMIN_ROOT."views/products/add.php";	
		}
		else{ // co du lieu gui len
			$fname=$_POST['txtfname'];
			$lname=$_POST['txtlname'];
			$email=$_POST['email'];
			$name = $_POST['txtuser'];
			$pass = $_POST['txtpass'];
			include DOC_ROOT."lib/connection.php";
			$con = sqlsrv_connect(SERVER,$conInfo);
			$stmt= sqlsrv_query($con,"INSERT INTO users VALUES(?,?,?,?,?)",array($fname,$lname,$email,$name,$pass));
			header("location:../index.php");			
		}
	?>